<?php

/**
 * AbetProjectList filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetProjectListFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'abet_project_id' => new sfWidgetFormPropelChoice(array('model' => 'AbetProject', 'add_empty' => true)),
      'abet_team_id'    => new sfWidgetFormPropelChoice(array('model' => 'AbetTeam', 'add_empty' => true)),
      'num_proj_list'   => new sfWidgetFormFilterInput(),
      'faculty_ranking' => new sfWidgetFormFilterInput(),
      'created_at'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'abet_project_id' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetProject', 'column' => 'id')),
      'abet_team_id'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetTeam', 'column' => 'id')),
      'num_proj_list'   => new sfValidatorPass(array('required' => false)),
      'faculty_ranking' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_project_list_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetProjectList';
  }

  public function getFields()
  {
    return array(
      'abet_project_id' => 'ForeignKey',
      'abet_team_id'    => 'ForeignKey',
      'num_proj_list'   => 'Text',
      'faculty_ranking' => 'Number',
      'created_at'      => 'Date',
      'updated_at'      => 'Date',
      'id'              => 'Number',
    );
  }
}
